package com.test.dubbo.extend;

import org.springframework.stereotype.Service;

import com.alibaba.dubbo.config.ReferenceConfig;

/**
 * 自定义的版本选择器,该类仅用于测试
 * @author wuchangzheng
 *
 */
@Service
public class VersionDesider implements IVersionDesider{
	
	String version="1.0";
	/**
	 * 客户端访问的远程服务在0.0和1.0之间切换
	 */
	@Override
	public String desideVersion(ReferenceConfig referenceConfig) {
		System.out.println("当前版本:"+referenceConfig.getVersion()+"==="+version);
		return version;
	}


	public void updateVersion(String version){
		this.version = version;
		System.out.println("修改版本版本:"+version);
	}
}